package com.wlh.service;

import com.wlh.util.DateUtil;

import java.util.Calendar;
import java.util.Date;

public class DateService {

    public static void main(String[] args) {
        System.out.println(DateUtil.getYear(new Date()));
        System.out.println(DateUtil.getMonth(new Date()));
        System.out.println(DateUtil.getDay(new Date()));
        System.out.println(DateUtil.getDayWeekOfDate1(new Date()));
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, 2018);
        Date sDate = calendar.getTime();
        calendar.set(Calendar.YEAR, 2019);
        Date eDate = calendar.getTime();
        System.out.println(DateUtil.getDistanceTimestamp(sDate, eDate));
    }
}
